using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using NiSis.Data;
using NiSis.Entities;

namespace NiSis.UserControls
{
    /// <summary>
    /// Elenco shipper di default: Prende gli shipper dalla tabella ssh_shipper_attivi_su_pool, se vuota prende gli shipper       
    /// definiti nella tabella ssh_pool.cd_shipper_default.
    /// </summary>
    public partial class ShipperDefault : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {


        }
        public void LoadList(string cdPool)
        {

            lstShippers.DataSource = DataRepositoryUtils.GetShippersDefaultInPool(cdPool);
            lstShippers.DataBind();
        }
        public void LoadList(string cdPool, string cdMese)
        {

            lstShippers.DataSource = CustomUtil.SelectDistinctFromIShipperTraderPool(DataRepositoryUtils.GetShippersDefaultInPool(cdPool, cdMese));
            lstShippers.DataBind();
        }
        /// <summary>
        /// Ritorna il codice del shipper selezionato nella lista. se vuota ritorna string.empty
        /// </summary>
        /// <returns></returns>
        public string SelectedShipper()
        {
            return lstShippers.SelectedValue;
        }
        public int Count()
        {
            return lstShippers.Items.Count;
        }

    }
}